import { debounce } from "lodash";
import { parseVerifyFormat } from "../../api/DesignTableApi";
import { getDataId } from "../../../../tools/Tools";
export const columnsList = [
    {
        dataIndex: "项目编号",
        key: "项目编号",
        title: "项目编号",
        width: 120,
    },
    // {
    //   dataIndex: "ItemName",
    //   key: "ItemName",
    //   title: "项目名称",
    //   width: 200,
    // },
    // {
    //   dataIndex: "FX",
    //   key: "FX",
    //   title: "方向",
    //   width: 80,
    // },
    // {
    //   dataIndex: "QCYE",
    //   key: "QCYE",
    //   title: "账面期初余额",
    //   width: 200,
    // },
    // {
    //   dataIndex: "JFLJFSE",
    //   key: "JFLJFSE",
    //   title: "账面借方发生额",
    //   width: 200,
    // },
    // {
    //   dataIndex: "DFLJFSE",
    //   key: "DFLJFSE",
    //   title: "账面贷方发生额",
    //   width: 200,
    // },
    // {
    //   dataIndex: "LJFSE",
    //   key: "LJFSE",
    //   title: "账面发生额",
    //   width: 200,
    // },
    // {
    //   dataIndex: "QMYE",
    //   key: "QMYE",
    //   title: "账面期末余额",
    //   width: 200,
    // },
    // {
    //   dataIndex: "QCZBJFJE",
    //   key: "QCZBJFJE",
    //   title: "期初账表借方调整",
    //   width: 200,
    // },
    // {
    //   dataIndex: "QCZBDFJE",
    //   key: "QCZBDFJE",
    //   title: "期初账表贷方调整",
    //   width: 200,
    // },
    // {
    //   dataIndex: "QCZBJE",
    //   key: "QCZBJE",
    //   title: "期初账表调整",
    // },
    // {
    //   dataIndex: "WSS",
    //   key: "WSS",
    //   title: "期初未审数",
    //   width: 200,
    // },
    // {
    //   dataIndex: "QCZXJFJE",
    //   key: "QCZXJFJE",
    //   title: "期初账项借方调整",
    //   width: 200,
    // },
    // {
    //   dataIndex: "QCZXDFJE",
    //   key: "QCZXDFJE",
    //   title: "期初账项贷方调整",
    //   width: 200,
    // },
    // {
    //   dataIndex: "QCZXJE",
    //   key: "QCZXJE",
    //   title: "期初账项调整",
    //   width: 200,
    // },
    // {
    //   dataIndex: "QCCFLJFJE",
    //   key: "QCCFLJFJE",
    //   title: "期初重分类借方调整",
    //   width: 200,
    // },
    // {
    //   dataIndex: "QCCFLDFJE",
    //   key: "QCCFLDFJE",
    //   title: "期初重分类贷方调整",
    //   width: 200,
    // },
    // {
    //   dataIndex: "QCCFLJE",
    //   key: "QCCFLJE",
    //   title: "期初重分类调整",
    //   width: 200,
    // },
    // {
    //   dataIndex: "QCSDS",
    //   key: "QCSDS",
    //   title: "期初审定数",
    //   width: 200,
    // },
    // // 20
    // {
    //   dataIndex: "ZBJFJE",
    //   key: "ZBJFJE",
    //   title: "账表借方调整",
    //   width: 200,
    // },
    // {
    //   dataIndex: "ZBDFJE",
    //   key: "ZBDFJE",
    //   title: "账表贷方调整",
    //   width: 200,
    // },
    // {
    //   dataIndex: "ZBJE",
    //   key: "ZBJE",
    //   title: "账表调整",
    //   width: 200,
    // },
    // {
    //   dataIndex: "WSS",
    //   key: "WSS",
    //   title: "未审数",
    //   width: 200,
    // },
    // {
    //   dataIndex: "ZXJFJE",
    //   key: "ZXJFJE",
    //   title: "账项借方调整",
    //   width: 200,
    // },
    // {
    //   dataIndex: "ZXDFJE",
    //   key: "ZXDFJE",
    //   title: "账项贷方调整",
    //   width: 200,
    // },
    // {
    //   dataIndex: "ZXJE",
    //   key: "ZXJE",
    //   title: "账项调整",
    //   width: 200,
    // },
    // {
    //   dataIndex: "CFLJFJE",
    //   key: "CFLJFJE",
    //   title: "重分类借方调整",
    //   width: 200,
    // },
    // {
    //   dataIndex: "CFLDFJE",
    //   key: "CFLDFJE",
    //   title: "重分类贷方调整",
    //   width: 200,
    // },
    // {
    //   dataIndex: "CFLJE",
    //   key: "CFLJE",
    //   title: "重分类调整",
    //   width: 200,
    // },
    // {
    //   dataIndex: "SDS",
    //   key: "SDS",
    //   title: "审定数",
    //   width: 200,
    // },
    // {
    //   dataIndex: "QCLJFSE",
    //   key: "QCLJFSE",
    //   title: "账面期初发生额",
    //   width: 200,
    // },
    // {
    //   dataIndex: "QCZBJFFSE",
    //   key: "QCZBJFFSE",
    //   title: "期初账表借方发生额调整",
    //   width: 200,
    // },
    // {
    //   dataIndex: "QCZBDFFSE",
    //   key: "QCZBDFFSE",
    //   title: "期初账表贷方发生额调整",
    //   width: 200,
    // },
    // {
    //   dataIndex: "QCZBFSE",
    //   key: "QCZBFSE",
    //   title: "期初账表发生额调整",
    //   width: 200,
    // },
    // {
    //   dataIndex: "QCWSLJFSE",
    //   key: "QCWSLJFSE",
    //   title: "期初未审发生额",
    //   width: 200,
    // },
    // {
    //   dataIndex: "QCZXJFFSE",
    //   key: "QCZXJFFSE",
    //   title: "期初账项借方发生额调整",
    //   width: 200,
    // },
    // {
    //   dataIndex: "QCZXDFFSE",
    //   key: "QCZXDFFSE",
    //   title: "期初账项贷方发生额调整",
    //   width: 200,
    // },
    // {
    //   dataIndex: "QCZXFSE",
    //   key: "QCZXFSE",
    //   title: "期初账项发生额调整",
    //   width: 200,
    // },
    // {
    //   dataIndex: "QCCFLJFFSE",
    //   key: "QCCFLJFFSE",
    //   title: "期初重分类借方发生额调整",
    //   width: 200,
    // },
    // {
    //   dataIndex: "QCCFLDFFSE",
    //   key: "QCCFLDFFSE",
    //   title: "期初重分类贷方发生额调整",
    //   width: 200,
    // },
    // {
    //   dataIndex: "QCCFLFSE",
    //   key: "QCCFLFSE",
    //   title: "期初重分类发生额调整",
    //   width: 200,
    // },
    // {
    //   dataIndex: "QCSDLJFSE",
    //   key: "QCSDLJFSE",
    //   title: "期初审定发生额",
    //   width: 200,
    // },
    // {
    //   dataIndex: "ZBJFFSE",
    //   key: "ZBJFFSE",
    //   title: "账表借方发生额调整",
    // },
    // {
    //   dataIndex: "ZBDFFSE",
    //   key: "ZBDFFSE",
    //   title: "账表贷方发生额调整",
    //   width: 200,
    // },
    // {
    //   dataIndex: "ZBFSE",
    //   key: "ZBFSE",
    //   title: "账表发生额调整",
    //   width: 200,
    // },
    // {
    //   dataIndex: "WSLJFSE",
    //   key: "WSLJFSE",
    //   title: "未审发生额",
    //   width: 200,
    // },
    // {
    //   dataIndex: "ZXJFFSE",
    //   key: "ZXJFFSE",
    //   title: "账项借方发生额调整",
    //   width: 200,
    // },
    // {
    //   dataIndex: "ZXDFFSE",
    //   key: "ZXDFFSE",
    //   title: "账项贷方发生额调整",
    //   width: 200,
    // },
    // {
    //   dataIndex: "ZXFSE",
    //   key: "ZXFSE",
    //   title: "账项发生额调整",
    //   width: 200,
    // },
    // {
    //   dataIndex: "CFLJFFSE",
    //   key: "CFLJFFSE",
    //   title: "重分类借方发生额调整",
    //   width: 200,
    // },
    // {
    //   dataIndex: "CFLDFFSE",
    //   key: "CFLDFFSE",
    //   title: "重分类贷方发生额调整",
    //   width: 200,
    // },
    // {
    //   dataIndex: "CFLFSE",
    //   key: "CFLFSE",
    //   title: "重分类发生额调整",
    //   width: 200,
    // },
    // {
    //   dataIndex: "SDLJFSE",
    //   key: "SDLJFSE",
    //   title: "审定发生额",
    //   width: 200,
    // },
    // {
    //   dataIndex: "QCZBHCJFFSE",
    //   key: "QCZBHCJFFSE",
    //   title: "期初账表红冲借方发生额调整",
    //   width: 200,
    // },
    // {
    //   dataIndex: "QCZBHCDFFSE",
    //   key: "QCZBHCDFFSE",
    //   title: "期初账表红冲贷方发生额调整",
    //   width: 200,
    // },
    // {
    //   dataIndex: "WSJFLJFSE",
    //   key: "WSJFLJFSE",
    //   title: "未审借方发生额",
    //   width: 200,
    // },
    // {
    //   dataIndex: "WSDFLJFSE",
    //   key: "WSDFLJFSE",
    //   title: "未审贷方发生额",
    //   width: 200,
    // },
];
export const dataTest = [
    {
        fullFormula: 'V_CROSS("期末金额")<=V_CROSS("期初金额")',
        type: "4",
        isForce: true,
        number: 1,
        verifyFormulaResultList: [
            {
                coords: {
                    row: 1,
                    col: 3,
                    rmap: "交易性金融资产",
                    cmap: "期初金额",
                },
                formula: 'IN_CELL("交易性金融资产","期初金额")',
                value: 914150,
            },
            {
                coords: {
                    row: 2,
                    col: 3,
                    rmap: "其中：债务工具投资",
                    cmap: "期初金额",
                },
                formula: 'IN_CELL("其中：债务工具投资","期初金额")',
                value: 546,
            },
            {
                coords: {
                    row: 3,
                    col: 3,
                    rmap: "权益工具投资",
                    cmap: "期初金额",
                },
                formula: 'IN_CELL("权益工具投资","期初金额")',
                value: 56,
            },
            {
                coords: {
                    row: 4,
                    col: 3,
                    rmap: "衍生金融资产",
                    cmap: "期初金额",
                },
                formula: 'IN_CELL("衍生金融资产","期初金额")',
                value: 456,
            },
            {
                coords: {
                    row: 5,
                    col: 3,
                    rmap: "理财产品",
                    cmap: "期初金额",
                },
                formula: 'IN_CELL("理财产品","期初金额")',
                value: 456546,
            },
            {
                coords: {
                    row: 6,
                    col: 3,
                    rmap: "其他",
                    cmap: "期初金额",
                },
                formula: 'IN_CELL("其他","期初金额")',
                value: 456546,
            },
            {
                coords: {
                    row: 7,
                    col: 3,
                    rmap: "指定为以公允价值计量且其变动计入当期损益的金融资产",
                    cmap: "期初金额",
                },
                formula: 'IN_CELL("指定为以公允价值计量且其变动计入当期损益的金融资产","期初金额")',
                value: 502202,
            },
            {
                coords: {
                    row: 8,
                    col: 3,
                    rmap: "指定为以公允价值计量的其中：债务工具投资",
                    cmap: "期初金额",
                },
                formula: 'IN_CELL("指定为以公允价值计量的其中：债务工具投资","期初金额")',
                value: 45656,
            },
        ],
        beVerifiedFormulaResultList: [
            {
                coords: {
                    row: 2,
                    col: 2,
                    rmap: "其中：债务工具投资",
                    cmap: "期末金额",
                },
                formula: 'IN_CELL("其中：债务工具投资","期末金额")',
                value: 534543,
                verifyItem: {
                    coords: {
                        row: 1,
                        col: 3,
                        rmap: "交易性金融资产",
                        cmap: "期初金额",
                    },
                    formula: 'IN_CELL("交易性金融资产","期初金额")',
                    value: 914150,
                },
                result: true,
                operationFormula: "534543 <= 914150",
            },
            {
                coords: {
                    row: 3,
                    col: 2,
                    rmap: "权益工具投资",
                    cmap: "期末金额",
                },
                formula: 'IN_CELL("权益工具投资","期末金额")',
                value: 43543,
                verifyItem: {
                    coords: {
                        row: 2,
                        col: 3,
                        rmap: "其中：债务工具投资",
                        cmap: "期初金额",
                    },
                    formula: 'IN_CELL("其中：债务工具投资","期初金额")',
                    value: 546,
                },
                result: false,
                operationFormula: "43543 <= 546",
            },
            {
                coords: {
                    row: 4,
                    col: 2,
                    rmap: "衍生金融资产",
                    cmap: "期末金额",
                },
                formula: 'IN_CELL("衍生金融资产","期末金额")',
                value: 435435,
                verifyItem: {
                    coords: {
                        row: 3,
                        col: 3,
                        rmap: "权益工具投资",
                        cmap: "期初金额",
                    },
                    formula: 'IN_CELL("权益工具投资","期初金额")',
                    value: 56,
                },
                result: false,
                operationFormula: "435435 <= 56",
            },
            {
                coords: {
                    row: 5,
                    col: 2,
                    rmap: "理财产品",
                    cmap: "期末金额",
                },
                formula: 'IN_CELL("理财产品","期末金额")',
                value: 4354,
                verifyItem: {
                    coords: {
                        row: 4,
                        col: 3,
                        rmap: "衍生金融资产",
                        cmap: "期初金额",
                    },
                    formula: 'IN_CELL("衍生金融资产","期初金额")',
                    value: 456,
                },
                result: false,
                operationFormula: "4354 <= 456",
            },
            {
                coords: {
                    row: 6,
                    col: 2,
                    rmap: "其他",
                    cmap: "期末金额",
                },
                formula: 'IN_CELL("其他","期末金额")',
                value: 3454,
                verifyItem: {
                    coords: {
                        row: 5,
                        col: 3,
                        rmap: "理财产品",
                        cmap: "期初金额",
                    },
                    formula: 'IN_CELL("理财产品","期初金额")',
                    value: 456546,
                },
                result: true,
                operationFormula: "3454 <= 456546",
            },
            {
                coords: {
                    row: 7,
                    col: 2,
                    rmap: "指定为以公允价值计量且其变动计入当期损益的金融资产",
                    cmap: "期末金额",
                },
                formula: 'IN_CELL("指定为以公允价值计量且其变动计入当期损益的金融资产","期末金额")',
                value: 601202,
                verifyItem: {
                    coords: {
                        row: 6,
                        col: 3,
                        rmap: "其他",
                        cmap: "期初金额",
                    },
                    formula: 'IN_CELL("其他","期初金额")',
                    value: 456546,
                },
                result: false,
                operationFormula: "601202 <= 456546",
            },
            {
                coords: {
                    row: 8,
                    col: 2,
                    rmap: "指定为以公允价值计量的其中：债务工具投资",
                    cmap: "期末金额",
                },
                formula: 'IN_CELL("指定为以公允价值计量的其中：债务工具投资","期末金额")',
                value: 546546,
                verifyItem: {
                    coords: {
                        row: 7,
                        col: 3,
                        rmap: "指定为以公允价值计量且其变动计入当期损益的金融资产",
                        cmap: "期初金额",
                    },
                    formula: 'IN_CELL("指定为以公允价值计量且其变动计入当期损益的金融资产","期初金额")',
                    value: 502202,
                },
                result: false,
                operationFormula: "546546 <= 502202",
            },
            {
                coords: {
                    row: 9,
                    col: 2,
                    rmap: "指定为以公允价值计量的其他",
                    cmap: "期末金额",
                },
                formula: 'IN_CELL("指定为以公允价值计量的其他","期末金额")',
                value: 54656,
                verifyItem: {
                    coords: {
                        row: 8,
                        col: 3,
                        rmap: "指定为以公允价值计量的其中：债务工具投资",
                        cmap: "期初金额",
                    },
                    formula: 'IN_CELL("指定为以公允价值计量的其中：债务工具投资","期初金额")',
                    value: 45656,
                },
                result: false,
                operationFormula: "54656 <= 45656",
            },
        ],
        fullFormulaResult: false,
        fullFormulaResultFormat: "1",
    },
    {
        fullFormula: 'IN_CELL("562562","金额") == IN_CELL("562562","金额")',
        fullFormulaResult: true,
        fullFormulaResultFormat: "2",
        verifyFormula: '=IN_CELL("562562","金额")',
        verifyFormulaResult: 783783,
        beVerifiedFormula: '=IN_CELL("562562","金额")',
        beVerifiedFormulaResult: 783783,
        verifyFormulaList: [
            {
                data_id: "无",
                rMap: "562562",
                cMap: "金额",
                type: "IN_CELL",
                value: 783783,
                tableName: "表内",
                coords: {
                    row: 1,
                    col: 2,
                },
                currentFormula: "IN_CELL(562562,金额)",
            },
        ],
        beVerifiedCoordsMap: {
            "IN_CELL(562562,金额)": {
                row: 1,
                col: 2,
            },
        },
        isForce: true,
        number: 1,
        type: "1",
        operation: "==",
    },
    {
        fullFormula: 'IN_CELL("562562","金额") == FS_CELL("base.reportItems","货币资金","账面期初余额","本年")',
        fullFormulaResult: false,
        fullFormulaResultFormat: "2",
        verifyFormula: '=FS_CELL("base.reportItems","货币资金","账面期初余额","本年")',
        verifyFormulaResult: 87183998.0801,
        beVerifiedFormula: '=IN_CELL("562562","金额")',
        beVerifiedFormulaResult: 783783,
        verifyFormulaList: [
            {
                data_id: "本年",
                rMap: "货币资金",
                cMap: "账面期初余额",
                type: "FS_CELL",
                value: 87183998.0801,
                tableName: "base.reportItems",
                currentFormula: "FS_CELL(base.reportItems,货币资金,账面期初余额,本年)",
            },
        ],
        beVerifiedCoordsMap: {
            "IN_CELL(562562,金额)": {
                row: 1,
                col: 2,
            },
        },
        isForce: true,
        number: 2,
        type: "3",
        operation: "==",
    },
    {
        fullFormula: 'IN_CELL("562562","金额") == FS_CELL("base.reportItems","货币资金","账面期初余额","本年")',
        fullFormulaResult: false,
        fullFormulaResultFormat: "2",
        verifyFormula: '=FS_CELL("base.reportItems","货币资金","账面期初余额","本年")',
        verifyFormulaResult: 87183998.0801,
        beVerifiedFormula: '=IN_CELL("562562","金额")',
        beVerifiedFormulaResult: 783783,
        verifyFormulaList: [
            {
                data_id: "本年",
                rMap: "货币资金",
                cMap: "账面期初余额",
                type: "FS_CELL",
                value: 87183998.0801,
                tableName: "base.reportItems",
                currentFormula: "FS_CELL(base.reportItems,货币资金,账面期初余额,本年)",
            },
        ],
        beVerifiedCoordsMap: {
            "IN_CELL(562562,金额)": {
                row: 1,
                col: 2,
            },
        },
        isForce: true,
        number: 3,
        type: "3",
        operation: "==",
    },
    {
        fullFormula: 'IN_CELL("562562","金额") == IN_CELL("562562","金额")',
        fullFormulaResult: true,
        fullFormulaResultFormat: "2",
        verifyFormula: '=IN_CELL("562562","金额")',
        verifyFormulaResult: 783783,
        beVerifiedFormula: '=IN_CELL("562562","金额")',
        beVerifiedFormulaResult: 783783,
        verifyFormulaList: [
            {
                data_id: "无",
                rMap: "562562",
                cMap: "金额",
                type: "IN_CELL",
                value: 783783,
                tableName: "表内",
                coords: {
                    row: 1,
                    col: 2,
                },
                currentFormula: "IN_CELL(562562,金额)",
            },
        ],
        beVerifiedCoordsMap: {
            "IN_CELL(562562,金额)": {
                row: 1,
                col: 2,
            },
        },
        isForce: true,
        number: 4,
        type: "1",
        operation: "==",
    },
    {
        fullFormula: 'IN_CELL("2323","金额") == CP_CELL("测试| 前","ddd","uu","本年")',
        fullFormulaResult: false,
        fullFormulaResultFormat: "2",
        verifyFormula: '=CP_CELL("测试| 前","ddd","uu","本年")',
        verifyFormulaResult: 0,
        beVerifiedFormula: '=IN_CELL("2323","金额")',
        beVerifiedFormulaResult: 32344,
        verifyFormulaList: [
            {
                data_id: "本年",
                rMap: "ddd",
                cMap: "uu",
                type: "CP_CELL",
                value: 0,
                tableName: "测试| 前",
                currentFormula: "CP_CELL(测试| 前,ddd,uu,本年)",
            },
        ],
        beVerifiedCoordsMap: {
            "IN_CELL(2323,金额)": {
                row: 1,
                col: 2,
            },
        },
        isForce: true,
        number: "1",
        type: "2",
        operation: "==",
    },
    {
        fullFormula: 'IN_CELL("232","金额") == CP_CELL("1| 前","测试","金额","本年")',
        fullFormulaResult: false,
        fullFormulaResultFormat: "2",
        verifyFormula: '=CP_CELL("1| 前","测试","金额","本年")',
        verifyFormulaResult: 0,
        beVerifiedFormula: '=IN_CELL("232","金额")',
        beVerifiedFormulaResult: 343,
        verifyFormulaList: [
            {
                data_id: "本年",
                rMap: "测试",
                cMap: "金额",
                type: "CP_CELL",
                value: 0,
                tableName: "1| 前",
                currentFormula: "CP_CELL(1| 前,测试,金额,本年)",
            },
        ],
        beVerifiedCoordsMap: {
            "IN_CELL(232,金额)": {
                row: 1,
                col: 2,
            },
        },
        isForce: true,
        number: "1",
        type: "2",
        operation: "==",
    },
];
export function createComprisonFunction(propertyName) {
    return function (object1, object2) {
        var value1 = object1[propertyName];
        var value2 = object2[propertyName];
        if (value1 < value2) {
            return -1;
        }
        else if (value1 > value2) {
            return 1;
        }
        else {
            return 0;
        }
    };
}
/**
 * 根据数组中的number重新排序校验公式
 */
export function formatValidtorData(array) {
    if (!array || !array.length) {
        return;
    }
    console.log(array, "array before");
    array.sort(function (a, b) {
        const aNumber = a.number.toString();
        const bNumber = b.number.toString();
        var aParts = aNumber.split("-");
        var bParts = bNumber.split("-");
        if (aParts[0] === bParts[0]) {
            if (aParts[1] && bParts[1]) {
                return parseInt(aParts[1]) - parseInt(bParts[1]);
            }
            else {
                return aNumber.localeCompare(bNumber);
            }
        }
        else {
            return parseInt(aParts[0]) - parseInt(bParts[0]);
        }
    });
    console.log(array, "array after");
    return array;
}
const fetchParseVerifyFormat = async (formula, params) => {
    const headerColumn = params.gridRef.headerService.headerColumn;
    const gridData = params.gridRef?.hot?.getData();
    const cpasTableType = params?.props?.type;
    const currentTName = params.gridRef?.props.name;
    try {
        const currentYear = await getDataId();
        const response = await parseVerifyFormat({
            display_data: gridData,
            headerColumn,
            formula,
            cpasTableType,
            currentTName: currentTName,
            currentYear,
        });
        if (response && response?.data) {
            return response?.data;
        }
    }
    catch (e) {
        throw e;
    }
};
export const debouncedApi = debounce(async (value, record, key, formulaKey, gridRef, dataList, setDataList) => {
    console.log(value, "debouncedApiCall", record);
    const { isNA = false, verifyFormat = "" } = await fetchParseVerifyFormat(value, gridRef);
    record[key] = verifyFormat ? verifyFormat : "";
    record[formulaKey] = value;
    dataList.map((item) => {
        if (item.number === record.number) {
            item[key] = verifyFormat ? verifyFormat : "";
            item[formulaKey] = value;
            if (key === "beVerifyFormat") {
                item["beVerifyIsNA"] = isNA;
            }
            else {
                item["verifyIsNA"] = isNA;
            }
        }
    });
    setDataList([...dataList]);
}, 500);
export function removeLeadingEquals(str) {
    if (!str) {
        return;
    }
    return str.replace(/^=+/, "");
}
//交叉校验数据转换拉平
export function transformCrossData(data, noTranform = false) {
    if (!data || !data.length) {
        return [];
    }
    let newList = [];
    for (let i = 0; i < data.length; i++) {
        const { type, beVerifiedFormulaResultList, number, isForce, verifyFormula, operation, verifyFormulaResultList, } = data[i];
        if (!noTranform &&
            +type === 4 &&
            beVerifiedFormulaResultList &&
            beVerifiedFormulaResultList.length) {
            let childVerifysResult = [];
            for (let j = 0; j < beVerifiedFormulaResultList.length; j++) {
                const { formula, verifyItem, value, result, formulaFormat, coords } = beVerifiedFormulaResultList[j];
                childVerifysResult.push({
                    type,
                    checkId: `${i + 1}-${j + 1}`,
                    number: `${number}-${j + 1}`,
                    isForce,
                    beVerifiedFormula: formula,
                    fullFormula: verifyItem?.formulaFormat,
                    beVerifiedFormulaResult: value,
                    verifyFormulaResult: verifyItem?.value,
                    fullFormulaResult: result,
                    verifyFormula,
                    operation,
                    beVerifiedFormulaResultList,
                    beVerifyFormat: formulaFormat,
                    verifyFormat: verifyItem?.formulaFormat,
                    verifyFormulaList: [
                        {
                            coords: verifyItem?.coords,
                            currentFormula: verifyItem?.formula,
                        },
                    ],
                    beVerifiedCoordsMap: {
                        [formula]: coords,
                    },
                });
            }
            if (childVerifysResult && childVerifysResult.length) {
                data[i].childVerifysResult = childVerifysResult;
            }
        }
        else {
            data[i].checkId = i + 1;
        }
        const { childVerifysResult } = data[i];
        if (+type !== 4 || noTranform) {
            newList.push(data[i]);
        }
        else if (childVerifysResult && childVerifysResult.length) {
            newList.push(...childVerifysResult);
        }
    }
    return newList;
}
